package com.scitc.pleasurevideo.util;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class HTMLContentUtil {
    public static Elements getElementsByAttributeValue(String html, String attribute, String name) {
        Document document = Jsoup.parse(html);
        return document.getElementsByAttributeValue(attribute, name);
    }

    public static Elements getElementsByClass(String html, String className, String name) {
        Document document = Jsoup.parse(html);
        return document.getElementsByClass(className);
    }

    public static Elements getElementsByTag(String html, String tagName) {
        Document document = Jsoup.parse(html);
        return document.getElementsByTag(tagName);
    }

    public static Element getElementsById(String html, String id) {
        Document document = Jsoup.parse(html);
        return document.getElementById(id);
    }

    static Elements getElementsByClassName(String html, String className) {
        Document document = Jsoup.parse(html);
        return document.html(html).getElementsByClass(className);
    }
}
